home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / ffread.z / ffread
Encoding:
Text File  |  1998-10-30  |  7.5 KB  |  154 lines

  1. FFREAD(3C)                                             Last changed: 3-5-98
  2.  
  3.  
  4. NNAAMMEE
  5.      ffffrreeaadd, ffffwwrriittee, ffffwweeooff, ffffwweeoodd, ffffrreeaaddff, ffffwwrriitteeff, ffffwweeooddff, ffffwweeooffff,
  6.      fffffflluusshh - Provides flexible file I/O
  7.  
  8. SSYYNNOOPPSSIISS
  9.      ##iinncclluuddee <<ffffiioo..hh>>
  10.  
  11.      UNICOS and UNICOS/mk systems:
  12.  
  13.         iinntt ffffrreeaadd ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b [[,, ssttrruucctt ffffssww **_s_t_a_t [[,,
  14.         iinntt _f_u_l_p [[,, iinntt **_u_b_c]]]]]]));;
  15.  
  16.         iinntt ffffwwrriittee ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b [[,, ssttrruucctt ffffssww
  17.         **_s_t_a_t [[,, iinntt _f_u_l_p [[,, iinntt **_u_b_c]]]]]]));;
  18.  
  19.         iinntt ffffwweeooff ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
  20.  
  21.         iinntt ffffwweeoodd ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
  22.  
  23.         iinntt fffffflluusshh ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
  24.  
  25.      IRIX systems:
  26.  
  27.         ssssiizzee__tt ffffrreeaadd ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b));;
  28.  
  29.         ssssiizzee__tt ffffwwrriittee ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b));;
  30.  
  31.         iinntt ffffwweeooff ((iinntt _f_d));;
  32.  
  33.         iinntt ffffwweeoodd ((iinntt _f_d));;
  34.  
  35.         iinntt fffffflluusshh ((iinntt _f_d));;
  36.  
  37.      All systems:
  38.  
  39.         ssiizzee__tt ffffrreeaaddff ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b ,, ssttrruucctt ffffssww **_s_t_a_t,,
  40.         iinntt _f_u_l_p,, iinntt **_u_b_c));;
  41.  
  42.         ssiizzee__tt ffffwwrriitteeff ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b ,, ssttrruucctt ffffssww
  43.         **_s_t_a_t,, iinntt _f_u_l_p,, iinntt **_u_b_c));;
  44.  
  45.         iinntt ffffwweeooffff ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
  46.  
  47.         iinntt ffffwweeooddff ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
  48.  
  49.         iinntt fffffflluusshh ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
  50.  
  51. IIMMPPLLEEMMEENNTTAATTIIOONN
  52.      UNICOS, UNICOS/mk, and IRIX systems
  53.  
  54. DDEESSCCRRIIPPTTIIOONN
  55.      The ffffrreeaadd and ffffwwrriittee functions provide flexible file I/O (FFIO) to
  56.      record-oriented or byte stream-oriented data in an
  57.      application-transparent manner.
  58.  
  59.      Function ffffwweeooff writes an end-of-file (EOF) if the function is
  60.      supported for the layer in use.
  61.  
  62.      Function ffffwweeoodd writes an end-of-data (EOD).  If the FFIO
  63.      specification is stream oriented, this requests truncation of the file
  64.      at the current position.
  65.  
  66.      Function fffffflluusshh instructs the layer to flush as much data to the file
  67.      as is convenient.  For some layers, and layers which do no buffering
  68.      (for example, the ssyyssccaallll layer), this operation does nothing.  For
  69.      record layers, the fffffflluusshh function will not terminate any partially-
  70.      written records.  This function is intended for use on files which are
  71.      being written.  It is undefined for files which are being read.
  72.  
  73.      The arguments are as follows:
  74.  
  75.      _f_d     Number returned by ffffooppeenn(3C).
  76.  
  77.      _b_u_f    Pointer to the user data buffer.
  78.  
  79.      _n_b     Requested number of bytes to be read or written.
  80.  
  81.      _s_t_a_t   Pointer to the returned status structure.
  82.  
  83.      _f_u_l_p   Either FFUULLLL or PPAARRTTIIAALL (defined in header file ffffiioo..hh);
  84.             indicates whether I/O should be performed in full or partial
  85.             record mode.
  86.  
  87.      _u_b_c    Unused bit count.  The word pointed to by this pointer is in
  88.             the range of 0 through 7; it is used to specify how many bits
  89.             in the last byte are not valid data.
  90.  
  91.      The _n_b and _u_b_c arguments are used together to determine an exact
  92.      number of bits to be transferred.  _n_b always indicates the number of
  93.      bytes affected by the data transfer, even if only one bit is
  94.      transferred in that byte.
  95.  
  96.      If argument _u_b_c is omitted, it is assumed to be 0.
  97.  
  98.      If _u_b_c is specified, it functions as both an input and output
  99.      argument.  It is passed to ffffrreeaadd or ffffwwrriittee as a request to omit
  100.      processing the specified number of bits in the last byte of the
  101.      request.  For example, to read 2 bits from a file, you should set _n_b
  102.      to 1, set the word at _u_b_c to 6, and call ffffrreeaadd.  On completion of the
  103.      ffffrreeaadd request, the word pointed to by _u_b_c is set by ffffrreeaadd to
  104.      indicate the number of unused bits in the last byte read.  As in the
  105.      preceding example, if only one bit were available to be read, then the
  106.      word at _u_b_c would be set to 7 by ffffrreeaadd.
  107.  
  108.      For ffffwwrriittee, _u_b_c is an input argument specifying the number of bits in
  109.      the last byte transferred that should not be written to the file.
  110.      Function ffffwwrriittee normally will not change the value of the word at
  111.      _u_b_c, because, if the specified number of bits is not written, an error
  112.      is returned.
  113.  
  114. RREETTUURRNN VVAALLUUEESS
  115.      Upon successful completion, a non-negative value is returned.
  116.      Otherwise, -1 is returned and, if the _s_t_a_t argument is passed, the
  117.      error value is found in ssttaatt..ssww__eerrrroorr.  If the _s_t_a_t parameter is not
  118.      provided, the error code is found in eerrrrnnoo.
  119.  
  120.      If the ssttaatt parameter is passed, the ssww__ssttaatt field is set to one of
  121.      the following values, indicating the condition that terminated the
  122.      operation:
  123.  
  124.      VVaalluuee    DDeessccrriippttiioonn
  125.  
  126.      FFFFEERRRR    An error was encountered.
  127.  
  128.      FFFFEEOORR    An end-of-record (EOR) was encountered.
  129.  
  130.      FFFFEEOOFF    An end-of-file (EOF) was encountered.
  131.  
  132.      FFFFEEOODD    An end-of-data (EOD) was encountered.
  133.  
  134.      FFFFCCNNTT    For layers without record handling, some data was read before
  135.               an EOF or EOD was encountered.
  136.  
  137.               For layers with record handling, the count was satisfied
  138.               before an EOR was encountered.  If the count was satisfied
  139.               simultaneously with encountering an EOR, the FFFFEEOORR status is
  140.               returned.
  141.  
  142.      The FFFFSSTTAATT macro, defined in ffffiioo..hh, can be used to obtain the value
  143.      of the ssww__ssttaatt field.
  144.  
  145. SSEEEE AALLSSOO
  146.      ffffooppeenn(3C), ffffsseeeekk(3C)
  147.  
  148.      aassggccmmdd(1)
  149.  
  150.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _I/_O _G_u_i_d_e, publication SG-2168
  151.  
  152.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication
  153.      SR-2165, for the printed version of this man page.
  154.